package com.wyl.auth.common.controller;

import com.wyl.auth.common.service.FileService;

import com.wyl.common.ResponseData;
import io.minio.errors.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

/**
 * @Description
 * @Author WuYiLong
 * @Date 2024/6/23 11:20
 */

@Api(tags = "文件服务")
@RestController
@RequestMapping(value = "file")
public class FileController {

    @Autowired
    private FileService fileService;

    @ApiOperation(value = "上传")
    @PostMapping(value = "upload")
    public ResponseData<String> upload(@RequestPart MultipartFile file) {
        return ResponseData.getSuccessInstance(fileService.upload(file));
    }
}